import os


class Solution:
    def longestCommonPrefix(self, strs):
        return os.path.commonprefix(strs)


if __name__ == '__main__':
    print(Solution().longestCommonPrefix(["cog", "cacecar", "car"]))
